import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/homepage',
  },
  {
    path: '/refresh',
    component: () => import('@/views/Utils/refresh')
  },
  {
    path: '/adminlogin',
    name: 'adminlogin',
    component: () => import('@/views/BackEndMn/AdminLogin.vue'),
  },
  {
    path: '/backendsys',
    name: 'backendsys',
    component: () => import('@/views/BackEndMn/BackEndSys.vue'),
    redirect: '/epusermn',
    children: [
      {
        path: '/epusermn',
        name: 'epusermn',
        component: () => import('@/views/BackEndMn/UserMn/EpUserMn.vue'),
      },
      {
        path: '/newepuser',
        name: 'newepuser',
        component: () => import('@/views/BackEndMn/UserMn/NewEpUser.vue'),
      },
      {
        path: '/gmusermn',
        name: 'gmusermn',
        component: () => import('@/views/BackEndMn/UserMn/GmUserMn.vue'),
      },
      {
        path: '/newgmuser',
        name: 'newgmuser',
        component: () => import('@/views/BackEndMn/UserMn/NewGmUser.vue'),
      },
      {
        path: '/policyformmn',
        name: 'policyformmn',
        component: () => import('@/views/BackEndMn/PolicyMn/PolicyFormMn.vue'),
      },
      {
        path: '/policyapplymn',
        name: 'policyapplymn',
        component: () => import('@/views/BackEndMn/PolicyMn/PolicyApplyMn.vue'),
      },
    ],
  },
  {
    path: '/newform',
    name: 'newform',
    component: () => import("@/views/GmMnSys/WorkMn/NewForm.vue"),
  },
  {
    path: '/gmhomepage',
    name: 'gmhomepage',
    component: () => import("@/views/GmHomePage.vue"),
    redirect: '/gmhomepagemenu',
    children: [

      {
        path: '/gmlogin',
        name: 'gmlogin',
        component: () => import("@/views/GmMnSys/GmLogin.vue"),
      },
      {
        path: '/gmhomepagemenu',
        name: 'gmhomepagemenu',
        component: () => import("@/views/GmMnSys/GmHomePageMenu.vue"),

      },
      {
        path: '/personal',
        name: 'personal',
        component: () => import("@/views/GmMnSys/Personal.vue"),
      },
      {
        path: '/workspace',
        name: 'workspace',
        component: () => import("@/views/GmMnSys/WorkSpace.vue"),
        redirect: '/formmn',
        children: [
          {
            path: '/formmn',
            name: 'formmn',
            component: () => import("@/views/GmMnSys/WorkMn/FormMn.vue"),
          },
          {
            path: '/approve',
            name: 'approve',
            component: () => import("@/views/GmMnSys/PesonalMn/Approve.vue"),
          }
        ]
      }
    ]
  },
  {
    //系统主页
    path: '/homepage',
    name: 'homepage',
    component: () => import("@/views/HomePage.vue"),
    redirect: '/homepagemenu',
    children: [
      {
        //企业账号登录
        path: '/login',
        name: 'login',
        component: () => import("@/views/EpMnSys/Login.vue"),
      },
      {
        // 企业账号注册
        path: '/register',
        name: 'register',
        component: () => import("@/views/EpMnSys/Register.vue"),
      },
      {
        // 系统主页菜单界面
        path: '/homepagemenu',
        name: 'homepagemenu',
        component: () => import("@/views/EpMnSys/HomePageMenu"),
      },
      {
        path: '/policyapply',
        name: 'policyapply',
        component: () => import("@/views/EpMnSys/PolicyApply.vue"),
      },
      {
        // 企业信息界面
        path: '/epbsinfo',
        name: 'epbsinfo',
        component: () => import("@/views/EpMnSys/EpBsInfo.vue"),
        redirect: '/basicinfo',
        children: [
          {
            // 企业基本信息
            path: '/basicinfo',
            name: 'basicinfo',
            component: () => import("@/views/EpMnSys/EpInfoMn/BasicInfo.vue"),
          },
          {
            // 企业政策兑现申请列表
            path: '/mypolicy',
            name: 'mypolicy',
            component: () => import("@/views/EpMnSys/EpInfoMn/MyPolicy.vue"),
          },
          {
            // 重置密码
            path: '/resetpwd',
            name: 'resetpwd',
            component: () => import("@/views/EpMnSys/EpInfoMn/ResetPwd.vue"),
          },
        ]
      }
    ]
  },


]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
